<?php
session_start();
if (!((isset($_SESSION['id']))&($_SESSION['identity']=="管理员"))) {
echo "<script>alert('非法操作，请先登录！');location.href='../login.php';</script>";
} else {
	header("Content-Type: text/html;charset=utf-8");
	error_reporting(0); //禁止错误输出
	include("../config.inc.php");
	 $sql=" insert into doctor(id,name,password,office,introduce)  values('{$_POST['工号']}','{$_POST['姓名']}','{$_POST['密码']}','{$_POST['科室']}','{$_POST['简介']}');"; 
	$res=$link->query($sql);
	if($res){
	 echo "<script>alert('增加成功')</script>";
	 echo "<script>window.location.href='chakanyisheng.php'</script>";
	}else{
	 echo "<script>alert('增加失败')</script>";
	 echo "<script>window.location.href='zengjiayisheng.php'</script>";
	}
}
?>